<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>opennars: nars.entity.TaskLink.novel</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">opennars
   &#160;<span id="projectnumber">1.5.5</span>
   </div>
   <div id="projectbrief">1.5-ish</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="../../index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="../../pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="../../namespaces.html"><span>Packages</span></a></li>
      <li><a href="../../annotated.html"><span>Classes</span></a></li>
      <li><a href="../../files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="../../search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('d9/d27/classnars_1_1entity_1_1TaskLink_afea026df0afd74986f940d10a7875a2f.html','../../');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="contents">
<a class="anchor" id="afea026df0afd74986f940d10a7875a2f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">boolean nars.entity.TaskLink.novel </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d4/d8b/classnars_1_1entity_1_1TermLink.html">TermLink</a>&#160;</td>
          <td class="paramname"><em>termLink</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>currentTime</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>To check whether a <a class="el" href="../../d9/d27/classnars_1_1entity_1_1TaskLink.html" title="Reference to a Task. ">TaskLink</a> should use a <a class="el" href="../../d4/d8b/classnars_1_1entity_1_1TermLink.html" title="A link between a compound term and a component term. ">TermLink</a>, return false if they interacted recently. </p>
<p>called in TermLinkBag only </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">termLink</td><td>The <a class="el" href="../../d4/d8b/classnars_1_1entity_1_1TermLink.html" title="A link between a compound term and a component term. ">TermLink</a> to be checked </td></tr>
    <tr><td class="paramname">currentTime</td><td>The current time </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Whether they are novel to each other </dd></dl>

<p>Definition at line <a class="el" href="../../d3/dce/TaskLink_8java_source.html#l00085">85</a> of file <a class="el" href="../../d3/dce/TaskLink_8java_source.html">TaskLink.java</a>.</p>

<p>References <a class="el" href="../../d3/dce/TaskLink_8java_source.html#l00041">nars.entity.TaskLink.counter</a>, <a class="el" href="../../d8/df2/Term_8java_source.html#l00094">nars.language.Term.equals()</a>, <a class="el" href="../../da/d1c/Sentence_8java_source.html#l00133">nars.entity.Sentence.getContent()</a>, <a class="el" href="../../d9/de0/Item_8java_source.html#l00074">nars.entity.Item.getKey()</a>, <a class="el" href="../../d6/d10/Task_8java_source.html#l00099">nars.entity.Task.getSentence()</a>, <a class="el" href="../../db/daa/TermLink_8java_source.html#l00143">nars.entity.TermLink.getTarget()</a>, and <a class="el" href="../../db/d0c/Memory_8java_source.html#l01139">nars.storage.Memory.Parameters.TERM_LINK_RECORD_LENGTH</a>.</p>

<p>Referenced by <a class="el" href="../../da/d69/TermLinkBag_8java_source.html#l00059">nars.storage.TermLinkBag.takeOut()</a>.</p>
<div class="fragment"><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;                                                              {</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;        Term bTerm = termLink.getTarget();</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;        <span class="keywordflow">if</span> (bTerm.equals(<a class="code" href="../../d9/d27/classnars_1_1entity_1_1TaskLink_a9b179154838fa2fea5e163b8aacee9a3.html#a9b179154838fa2fea5e163b8aacee9a3">targetTask</a>.<a class="code" href="../../dc/ddc/classnars_1_1entity_1_1Task_ab140cb553a6cf40b07093d1df283567f.html#ab140cb553a6cf40b07093d1df283567f">getSentence</a>().<a class="code" href="../../d6/d25/classnars_1_1entity_1_1Sentence_ad1ded9a02cae3557948d05530cd4d37e.html#ad1ded9a02cae3557948d05530cd4d37e">getContent</a>())) {</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;        }</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;        String linkKey = termLink.getKey();</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;        <span class="keywordtype">int</span> next = 0;</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;        <span class="keywordtype">int</span> i;</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;        <span class="keywordflow">for</span> (i = 0; i &lt; <a class="code" href="../../d9/d27/classnars_1_1entity_1_1TaskLink_a625a62924f39fbcaad6b5e2a799393d9.html#a625a62924f39fbcaad6b5e2a799393d9">counter</a>; i++) {</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;            next = i % Memory.Parameters.TERM_LINK_RECORD_LENGTH;</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;            <span class="keywordflow">if</span> (linkKey.equals(<a class="code" href="../../d9/d27/classnars_1_1entity_1_1TaskLink_ab09ee26890f38c3e532da7bac1d5cc67.html#ab09ee26890f38c3e532da7bac1d5cc67">recordedLinks</a>[next])) {</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;                <span class="keywordflow">if</span> (currentTime &lt; <a class="code" href="../../d9/d27/classnars_1_1entity_1_1TaskLink_a8219e84e2e88420ef548f493bafa6891.html#a8219e84e2e88420ef548f493bafa6891">recordingTime</a>[next] + Memory.Parameters.TERM_LINK_RECORD_LENGTH) {</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;                    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;                } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;                    <a class="code" href="../../d9/d27/classnars_1_1entity_1_1TaskLink_a8219e84e2e88420ef548f493bafa6891.html#a8219e84e2e88420ef548f493bafa6891">recordingTime</a>[next] = currentTime;</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;                    <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;                }</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;            }</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;        }</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;        next = i % Memory.Parameters.TERM_LINK_RECORD_LENGTH;</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;        <a class="code" href="../../d9/d27/classnars_1_1entity_1_1TaskLink_ab09ee26890f38c3e532da7bac1d5cc67.html#ab09ee26890f38c3e532da7bac1d5cc67">recordedLinks</a>[next] = linkKey;       <span class="comment">// add knowledge reference to recordedLinks</span></div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;        <a class="code" href="../../d9/d27/classnars_1_1entity_1_1TaskLink_a8219e84e2e88420ef548f493bafa6891.html#a8219e84e2e88420ef548f493bafa6891">recordingTime</a>[next] = currentTime;</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;        <span class="keywordflow">if</span> (counter &lt; Memory.Parameters.TERM_LINK_RECORD_LENGTH) { <span class="comment">// keep a constant length</span></div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;            counter++;</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;        }</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    }</div>
<div class="ttc" id="classnars_1_1entity_1_1TaskLink_a8219e84e2e88420ef548f493bafa6891_html_a8219e84e2e88420ef548f493bafa6891"><div class="ttname"><a href="../../d9/d27/classnars_1_1entity_1_1TaskLink_a8219e84e2e88420ef548f493bafa6891.html#a8219e84e2e88420ef548f493bafa6891">nars.entity.TaskLink.recordingTime</a></div><div class="ttdeci">long recordingTime[]</div><div class="ttdoc">Remember the time when each TermLink is used with this TaskLink. </div><div class="ttdef"><b>Definition:</b> <a href="../../d3/dce/TaskLink_8java_source.html#l00039">TaskLink.java:39</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1Task_ab140cb553a6cf40b07093d1df283567f_html_ab140cb553a6cf40b07093d1df283567f"><div class="ttname"><a href="../../dc/ddc/classnars_1_1entity_1_1Task_ab140cb553a6cf40b07093d1df283567f.html#ab140cb553a6cf40b07093d1df283567f">nars.entity.Task.getSentence</a></div><div class="ttdeci">Sentence getSentence()</div><div class="ttdoc">Get the sentence. </div><div class="ttdef"><b>Definition:</b> <a href="../../d6/d10/Task_8java_source.html#l00099">Task.java:99</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TaskLink_ab09ee26890f38c3e532da7bac1d5cc67_html_ab09ee26890f38c3e532da7bac1d5cc67"><div class="ttname"><a href="../../d9/d27/classnars_1_1entity_1_1TaskLink_ab09ee26890f38c3e532da7bac1d5cc67.html#ab09ee26890f38c3e532da7bac1d5cc67">nars.entity.TaskLink.recordedLinks</a></div><div class="ttdeci">String recordedLinks[]</div><div class="ttdoc">Remember the TermLinks that has been used recently with this TaskLink. </div><div class="ttdef"><b>Definition:</b> <a href="../../d3/dce/TaskLink_8java_source.html#l00037">TaskLink.java:37</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1Sentence_ad1ded9a02cae3557948d05530cd4d37e_html_ad1ded9a02cae3557948d05530cd4d37e"><div class="ttname"><a href="../../d6/d25/classnars_1_1entity_1_1Sentence_ad1ded9a02cae3557948d05530cd4d37e.html#ad1ded9a02cae3557948d05530cd4d37e">nars.entity.Sentence.getContent</a></div><div class="ttdeci">Term getContent()</div><div class="ttdoc">Get the content of the sentence. </div><div class="ttdef"><b>Definition:</b> <a href="../../da/d1c/Sentence_8java_source.html#l00133">Sentence.java:133</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TaskLink_a625a62924f39fbcaad6b5e2a799393d9_html_a625a62924f39fbcaad6b5e2a799393d9"><div class="ttname"><a href="../../d9/d27/classnars_1_1entity_1_1TaskLink_a625a62924f39fbcaad6b5e2a799393d9.html#a625a62924f39fbcaad6b5e2a799393d9">nars.entity.TaskLink.counter</a></div><div class="ttdeci">int counter</div><div class="ttdoc">The number of TermLinks remembered. </div><div class="ttdef"><b>Definition:</b> <a href="../../d3/dce/TaskLink_8java_source.html#l00041">TaskLink.java:41</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TaskLink_a9b179154838fa2fea5e163b8aacee9a3_html_a9b179154838fa2fea5e163b8aacee9a3"><div class="ttname"><a href="../../d9/d27/classnars_1_1entity_1_1TaskLink_a9b179154838fa2fea5e163b8aacee9a3.html#a9b179154838fa2fea5e163b8aacee9a3">nars.entity.TaskLink.targetTask</a></div><div class="ttdeci">Task targetTask</div><div class="ttdoc">The Task linked. </div><div class="ttdef"><b>Definition:</b> <a href="../../d3/dce/TaskLink_8java_source.html#l00035">TaskLink.java:35</a></div></div>
</div><!-- fragment -->
<p><div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="../../closed.png" alt="+"/> Here is the call graph for this function:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><div class="zoom"><iframe scrolling="no" frameborder="0" src="../../d9/d27/classnars_1_1entity_1_1TaskLink_afea026df0afd74986f940d10a7875a2f_afea026df0afd74986f940d10a7875a2f_cgraph.svg" width="100%" height="504"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div>
</p>

<p><div id="dynsection-1" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-1-trigger" src="../../closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-1-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-1-content" class="dyncontent" style="display:none;">
<div class="center"><div class="zoom"><iframe scrolling="no" frameborder="0" src="../../d9/d27/classnars_1_1entity_1_1TaskLink_afea026df0afd74986f940d10a7875a2f_afea026df0afd74986f940d10a7875a2f_icgraph.svg" width="100%" height="300"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div>
</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="../../d7/d81/namespacenars.html">nars</a></li><li class="navelem"><a class="el" href="../../db/dec/namespacenars_1_1entity.html">entity</a></li><li class="navelem"><a class="el" href="../../d9/d27/classnars_1_1entity_1_1TaskLink.html">TaskLink</a></li>
    <li class="footer">Generated on Sun Jan 10 2016 18:03:59 for opennars by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.9.1 </li>
  </ul>
</div>
</body>
</html>
